<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>{$web.name} - {$web.title}</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
{load href="__PUBLIC__/base/base.css,__PUBLIC__/js/do.js,__PUBLIC__/js/package.js" /}
<style type="text/css">
html,body {font-family: "Source Sans Pro","Helvetica Neue",Helvetica, Arial,sans-serif, "Microsoft YaHei";color: #242A31;font-size: 15px;background: #F5F7F9;}
.login{width:500px;margin:10% auto 0 auto;text-align: center;border: 1px solid #d4dadf;background: #fff;box-shadow: 0px 1px 12px 0px rgba(0, 0, 0, 0.2);border-radius: 4px;padding-bottom:10px;}
.login input{width:380px;margin:10px 0px;padding:10px;border: 1px solid #d7d7d7;border-radius: 5px;font-size: 14px;color: #666;border-radius:2px;box-shadow: 0 0.1rem 0.25rem rgba(0, 0, 0, 0.1) inset;}
.login input:focus {outline: none;}
.login .header{text-align: center;padding:20px;border-bottom: 1px #d4dadf solid;font-size:25px}
.login .row{margin:20px auto;}
.login .btn{height:45px;width:380px;line-height:45px;font-size:16px;text-align:center;outline:0;border:0;background-color: #2878FF;color: #FFF;border-radius: 5px;box-shadow: 0 1px 6px rgba(0,0,0,.117647), 0 1px 4px rgba(0,0,0,.117647);}
.login .btn:hover{background-color:#246CE5;}
.login .captcha{margin: auto;width: 380px;}
.login .captcha input{width: 150px;}
.login .captcha img{width:220px;margin:10px 0px;height: 44px;}
</style>
</head>
<body>
<form class="login" action="{:url('system/admin.index/login')}">
    <input type="hidden" name="__token__" value="{$Request.token}" />
    <div class="header"><img src="__PUBLIC__/admin/weblogo.png" /></div>
    <div class="row fn-clear">
        <input autocomplete="off" datatype="*" class="input" type="text" name="login_id" placeholder="用户名" x-webkit-speech />
        <input autocomplete="off" datatype="*" class="input" type="password" name="login_password" placeholder="密码" />
        <div class="captcha">
            <div class="fn-left"><input autocomplete="off" datatype="*" class="input" type="text" name="captcha" placeholder="验证码" /></div>
            <div class="fn-right"><img id="captcha"  src="{:captcha_src()}" alt="captcha" onclick="reimg()"/></div>
        </div>        
    </div>
    <div class="row"><button class="btn" type="submit">登 录</button></div>
</form>
<script type = "text/javascript" >
  Do('layer', 'form',function() {
    $(".login").Validform({
        ajaxPost: true,postonce: true,
        tiptype:function(){},
        callback: function(data) {
            if (data.code == 200) {
                window.location.href = data.url;
            } else {
                layer.alert(data.msg,{icon:5},function(index){
                    layer.close(index);
                    location.reload();
                });
            }
        }
    });
  })
  //刷新验证码
  function reimg(){
    var img = document.getElementById("captcha");
    img.src = "{:captcha_src()}?rnd=" + Math.random();
  }
</script>
</body>
</html>